package homework.clazz.Demo5;

public class Rectangle extends Shape
{ private double width;
private double height;
public Rectangle(String shapeName,double width,double height)
{
super(shapeName);
this.width=width;
this.height=height;
}
public double getArea()//实现抽象方法
{
return width*height;
}
public double getLength() //实现抽象方法
{
return 2*(width+height);
}
}
